home *** CD-ROM | disk | FTP | other *** search
/ Cocktail Hour / image.iso / COCKTAIL.DIR / Internal_22_buttons scripts.ls < prev    next >
Encoding:
Text File  |  1997-03-05  |  9.8 KB  |  231 lines

  1. on buttonPressedUp nButton, CurrScreen
  2.   global SoundActive, Navigate, Fade, CurrVideo, gTriviaQuestMem, Food, Choice, MyFavorites, forClear, RecipeNum, gProgrmPathOnHD, AfterFavorite
  3.   set Navigate to 0
  4.   set nButton to nButton - 41
  5.   set buttonVec to ["sound", "main", "back", "help", "print", "quit", "favorites"]
  6.   set buttonPressed to getAt(buttonVec, nButton)
  7.   if nButton = 1 then
  8.     if soundBusy(1) = 0 then
  9.       if (CurrScreen = "enter") or (CurrScreen = "party") or (CurrScreen = "history") then
  10.         set CurrScreen to "slides"
  11.       else
  12.         if (CurrScreen = "query") or (CurrScreen = "non-alco") or (CurrScreen = "spirits") then
  13.           set CurrScreen to "drinks"
  14.         else
  15.           if CurrScreen = "hangover" then
  16.             set CurrScreen to "hang"
  17.           end if
  18.         end if
  19.       end if
  20.       if CurrScreen = "objects" then
  21.         nothing()
  22.       else
  23.         sound playFile 1, gProgrmPathOnHD & CurrScreen
  24.         set SoundActive to 1
  25.       end if
  26.     else
  27.       set SoundActive to 0
  28.       sound stop 1
  29.     end if
  30.   else
  31.     if nButton = 2 then
  32.       set x to the number of lines in field "backField"
  33.       put marker("main") into line x + 1 of field "backField"
  34.       set Fade to 1
  35.       clearPuppets()
  36.       if soundBusy(1) then
  37.         set SoundActive to 1
  38.       end if
  39.       go(marker("main"))
  40.     else
  41.       if nButton = 3 then
  42.         set Navigate to EMPTY
  43.         if marker(0) = marker("drinks") then
  44.           set Fade to 1
  45.         end if
  46.         if the number of lines in field "backField" > 1 then
  47.           cursor(4)
  48.           set x to the number of lines in field "backField"
  49.           if the number of items in line x of field "backField" = 1 then
  50.             set prevMark to the value of line x of field "backField"
  51.           else
  52.             if item 2 of line x of field "backField" = "objects" then
  53.               set prevMark to the value of item 1 of line x of field "backField"
  54.               set Choice to item 3 of line x of field "backField"
  55.               set RecipeNum to value(item 4 of line x of field "backField")
  56.             end if
  57.           end if
  58.           delete line x of field "backField"
  59.           clearPuppets()
  60.           go(prevMark)
  61.         end if
  62.       else
  63.         if nButton = 4 then
  64.           set x to the frame
  65.           if (x > 85) and (x < 122) then
  66.             set x to "spirits"
  67.           else
  68.             if x = 583 then
  69.               set x to "11"
  70.             else
  71.               if ((x > 125) and (x < 182)) or (x = 191) or (x = 196) then
  72.                 if (CurrVideo <> " ") and (CurrVideo <> EMPTY) then
  73.                   set x to "VidS"
  74.                 else
  75.                   set x to "NoVidS"
  76.                 end if
  77.               else
  78.                 set x to the frame & EMPTY
  79.               end if
  80.             end if
  81.           end if
  82.           if soundBusy(2) = 0 then
  83.             puppetSound(2, member x of castLib "help")
  84.           else
  85.             puppetSound(2, 0)
  86.           end if
  87.         else
  88.           if nButton = 5 then
  89.             set the text of field "maxfield" to EMPTY
  90.             if CurrScreen = "history" then
  91.               put "History" & RETURN into field "PrintTitle"
  92.               put the number of member "PrintTitle" into line 1 of field "MaxField"
  93.               put the number of member "hist3" into line 2 of field "MaxField"
  94.               put the number of member "MaxSpace2" into line 3 of field "MaxField"
  95.               put the number of member "hist2" into line 4 of field "MaxField"
  96.               put the number of member "MaxSpace2" into line 5 of field "MaxField"
  97.               put the number of member "hist1" into line 6 of field "MaxField"
  98.               maxprint("text")
  99.             else
  100.               if CurrScreen = "party" then
  101.                 put "World Party" & RETURN into field "PrintTitle"
  102.                 put the number of member "PrintTitle" into line 1 of field "MaxField"
  103.                 repeat with i = 1 to 12
  104.                   put the number of member ("month" & i) into line i * 2 of field "MaxField"
  105.                   put the number of member "MaxSpace2" into line (i * 2) + 1 of field "MaxField"
  106.                 end repeat
  107.                 maxprint("text")
  108.               else
  109.                 if CurrScreen = "hangOver" then
  110.                   put "Hangover" & RETURN into field "PrintTitle"
  111.                   put the number of member "PrintTitle" into line 1 of field "MaxField"
  112.                   put the number of member "hangt3" into line 2 of field "MaxField"
  113.                   put the number of member "MaxSpace2" into line 3 of field "MaxField"
  114.                   put the number of member "hangt2" into line 4 of field "MaxField"
  115.                   put the number of member "MaxSpace2" into line 5 of field "MaxField"
  116.                   put the number of member "hangt1" into line 6 of field "MaxField"
  117.                   maxprint("text")
  118.                 else
  119.                   if CurrScreen = "trivia" then
  120.                     if (the text of field "score" of castLib "TriviaEx.cst" = 10) and (the last char in gTriviaQuestMem = 1) then
  121.                       put the number of member "trivia base mat.1.board" into line 1 of field "MaxField"
  122.                       maxprint("text")
  123.                     end if
  124.                   else
  125.                     if char 1 to 6 of CurrScreen = (("spirit" & char 7 of CurrScreen) <> "s") then
  126.                     else
  127.                       if CurrScreen = "objects" then
  128.                         if the visible of sprite 31 then
  129.                           put "Notes" & RETURN into field "PrintTitle"
  130.                           put the number of member "PrintTitle" into line 1 of field "MaxField"
  131.                           put the number of member "currNotes" into line 2 of field "MaxField"
  132.                           maxprint("text")
  133.                         else
  134.                           if marker(0) = marker("foodP") then
  135.                             put the number of member ("toPrint" & Food) into line 1 of field "MaxField"
  136.                             maxprint("text")
  137.                           else
  138.                             put Choice into line 1 of field "MaxField"
  139.                             put the number of member RecipeNum of castLib "slideNW" into line 2 of field "Maxfield"
  140.                             put the number of member "MaxSpace" into line 3 of field "MaxField"
  141.                             put the number of member "MaxSpace" into line 4 of field "MaxField"
  142.                             put the text of member "tarInfo2" into field "TarInfo"
  143.                             put the number of member "tarInfo" into line 5 of field "MaxField"
  144.                             set x to the number of lines in the text of member ("recipe" & RecipeNum)
  145.                             put line x - 7 to x of the text of member ("recipe" & RecipeNum) into field "on the base"
  146.                             set y1 to offset("@", field "on the base")
  147.                             put " " into char y1 of field "on the base"
  148.                             set y2 to offset("@", field "on the base")
  149.                             put " " into char y2 of field "on the base"
  150.                             put the number of member "MaxSpace2" into line 6 of field "MaxField"
  151.                             put the number of member "on the base" into line 7 of field "MaxField"
  152.                             maxprint("tour")
  153.                           end if
  154.                         end if
  155.                       end if
  156.                     end if
  157.                   end if
  158.                 end if
  159.               end if
  160.             end if
  161.           else
  162.             if nButton = 6 then
  163.               windowRoutine()
  164.               set shop1 to field "shop1"
  165.               set shop2 to field "shop2"
  166.               tell window "notes"
  167.                 set the text of field "shop1" to shop1
  168.               end tell
  169.               tell window "notes"
  170.                 set the text of field "shop2" to shop2
  171.               end tell
  172.               tell window "notes"
  173.                 saveMovie()
  174.               end tell
  175.               forget(window "notes")
  176.               clearPuppets()
  177.               quit()
  178.             else
  179.               if nButton = 7 then
  180.                 set MyFavorites to 1
  181.                 if (the frame > 123) and (the frame < 205) and forClear then
  182.                   windowRoutine()
  183.                   set x to field "currNotes"
  184.                   tell window "notes"
  185.                     set the text of field (RecipeNum + 50) to x
  186.                   end tell
  187.                   tell window "notes"
  188.                     saveMovie()
  189.                   end tell
  190.                 end if
  191.                 if the stageRight > 640 then
  192.                   set winRect to rect(318, 172, 716, 494)
  193.                 else
  194.                   set winRect to rect(238, 111, 634, 431)
  195.                 end if
  196.                 set the modal of window "favorite" to 1
  197.                 set the titleVisible of window "favorite" to 0
  198.                 set the windowType of window "favorite" to 3
  199.                 set the rect of window "favorite" to winRect
  200.                 set AfterFavorite to 1
  201.                 set the fileName of window "favorite" to gProgrmPathOnHD & "favorite.dir"
  202.                 open(window "favorite")
  203.               end if
  204.             end if
  205.           end if
  206.         end if
  207.       end if
  208.     end if
  209.   end if
  210. end
  211.  
  212. on buttonPressedDown nButton, CurrScreen
  213.   set bDown to the clickOn
  214.   set nButton to nButton - 41
  215.   set buttonVec to ["sound", "main", "back", "help", "print", "quit", "favorites"]
  216.   set buttonPressed to getAt(buttonVec, nButton)
  217.   if nButton = 1 then
  218.     if soundBusy(1) = 1 then
  219.       set the member of sprite 42 to member "soundDown"
  220.     else
  221.       set the member of sprite 42 to member "puppetOrigin"
  222.     end if
  223.   else
  224.     set the member of sprite bDown to member (buttonPressed & "Down")
  225.     updateStage()
  226.     repeat while the mouseDown
  227.     end repeat
  228.     set the member of sprite bDown to member "puppetOrigin"
  229.   end if
  230. end
  231.